package top.guoyang.springboot3.kaoshi.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import top.guoyang.springboot3.annotation.Limit;
import top.guoyang.springboot3.base.PageBean;
import top.guoyang.springboot3.base.R;
import top.guoyang.springboot3.entity.TbContact.TbContact;
import top.guoyang.springboot3.kaoshi.entity.TbExamInfo;
import top.guoyang.springboot3.kaoshi.service.TbExamInfoService;
import top.guoyang.springboot3.validate.CommonValidate;
import top.guoyang.springboot3.vo.PageVO;

@RestController
@RequestMapping("/examInfo")
@RequiredArgsConstructor
public class TbExamInfoController {
    private final TbExamInfoService tbExamInfoService;

    @PostMapping("")
    public R<String> insert(@RequestBody @Validated(CommonValidate.Add.class) TbExamInfo tbExamInfo){
        return tbExamInfoService.insert(tbExamInfo);
    }

    @DeleteMapping("/{id}")
    public R<String>delete(@PathVariable("id")Integer id){return tbExamInfoService.delete(id);

    }
    @PutMapping("")
    public R<String> update(@RequestBody @Validated(CommonValidate.Edit.class) TbExamInfo tbExamInfo){
        return tbExamInfoService.update(tbExamInfo);
    }



}
